import { Column } from '_typeorm@0.2.34@typeorm';

export interface BodyProps {
  xml: XmlProps;
}

export interface XmlProps {
  ToUserName: string;
  Encrypt: string;
  AgenID: string;
}

export interface QueryProps {
  msg_signature: string;
  timestamp: number;
  nonce: string;
  echostr?: string;
}

export interface MsgProps {
  message?: string;
  id?: string;
  random?: Buffer;
}

export interface MsgDto {
  msg: string;
}

export interface AuthProps {
  SuiteId: Array<string>;
  InfoType: Array<string>;
  TimeStamp: Array<string>;
  AuthCode?: Array<string>;
  SuiteTicket?: Array<string>;
  AuthCorpId?: Array<string>;
  ChangeType?: Array<string>;
  UserID?: Array<string>;
  NewUserID?: Array<string>;
  OpenUserID?: Array<string>;
}

export interface SuiteAccessTokenProps {
  suite_access_token: string;
  expires_in: number;
}

export interface PreAuthCodeProps {
  errcode: number;
  errmsg: string;
  pre_auth_code: string;
  expires_in: number;
}

export interface permanentCodeProps {
  access_token: string;
  expires_in: number;
  permanent_code: string;
  auth_corp_info: corpInfoProps;
  auth_user_info: authUserInfoProps;
  auth_info: {
    agent: Array<agentInfoProps>;
  };
}

interface authUserInfoProps {
  userid: string;
  name: string;
  avatar: string;
  open_userid: string;
}
interface corpInfoProps {
  corpid: string;
  corp_name: string;
  corp_type: string;
  corp_round_logo_url: string;
  corp_square_logo_url: string;
  corp_user_max: number;
  corp_agent_max: number;
  corp_wxqrcode: string;
  corp_full_name: string;
  subject_type: number;
  corp_scale: string;
  corp_industry: string;
  corp_sub_industry: string;
  location: string;
}

interface privilegeInfoProps {
  level: number;
  allow_party: Array<number>;
  allow_user: Array<string>;
  allow_tag: Array<number>;
  extra_party: Array<number>;
  extra_user: Array<string>;
  extra_tag: Array<number>;
}

interface corpIdInfoProps {
  corpid: string;
}

interface agentInfoProps {
  agentid: number;
  name: string;
  round_logo_url: string;
  square_logo_url: string;
  appid: number;
  auth_mode: number;
  privilege: privilegeInfoProps;
  shared_from: corpIdInfoProps;
}

export interface CorpProps {
  accessToken: string;
  expiresIn: number;
  accessTokenExpiresAt: Date;
  permanentCode: string;
  corpId: string;
  corpName: string;
  corpType: string;
  corpRoundLogoUrl: string;
  corpSquareLogoUrl: string;
  corpUserMax: number;
  corpAgentMax: number;
  corpFullName: string;
  verifiedEndTime?: number;
  subjectType: number;
  qrcode: string;
  scale: string;
  industry: string;
  subIndustry: string;
  location: string;
  userid: string;
  openUserId: string;
  name: string;
  avatar: string;
  agentId: number;
  agentName: string;
  agentLogo: string;
  msg: string;
}

export interface CorpAccessTokenProps {
  access_token: string;
  expires_in: 7200;
}

export interface DeptProps {
  id: number;
  name: string;
  name_en: string;
  parentid: number;
  order: number;
}

export interface DeptListProps {
  department: Array<DeptProps>;
}

export interface DeptInterface {
  corpId: string;
  cId: number;
  name: string;
  parentId: number;
  order: number;
  name_en: string;
}

export interface UserProps {
  userid: string;
  name: string;
  department: Array<number>;
  gender: string;
  avatar: string;
  status: number;
  order: Array<number>;
  main_department: number;
  is_leader_in_dept: Array<number>;
  thumb_avatar: string;
  open_userid: string;
}
export interface UserListProps {
  userlist: Array<UserProps>;
}

export interface UserDto {
  id?: number;
  corpId: string;
  userId: string;
  name: string;
  department: string;
  gender: string;
  avatar: string;
  status: number;
  order: string;
  mainDepartment: number;
  isLeaderInDept: string;
  thumbAvatar: string;
  openUserId: string;
}
